---
title: Divider | gluestack-ui | Installation, Usage, and API

description: Revamp your content organization with the Divider component! Use it to visually separate different sections of a list or group for a more structured and easy-to-read interface.

pageTitle: Divider

pageDescription: Revamp your content organization with the Divider component! Use it to visually separate different sections of a list or group for a more structured and easy-to-read interface.

showHeader: true
---

import { Meta } from '@storybook/addon-docs';

<Meta title="ui/Components/Layout/Divider" />

import { Divider, VStack, HStack } from './Divider';
import { Center, Text, Button, ButtonText } from './Divider';
import { Box, Heading } from './Divider';
import { transformedCode } from '../../../utils';
import {
  AppProvider,
  CodePreview,
  Table,
  TableContainer,
  InlineCode,
} from '@gluestack/design-system';
import Wrapper from '../../Wrapper';

This is an illustration of a **Themed Divider** component with default configuration.

<AppProvider>
  <CodePreview
    showComponentRenderer={true}
    showArgsController={false}
    metaData={{
      code: `
        <Center>
          <Text>
            Easy
          </Text>
          <Divider my="$0.5"/>
          <Text>
            Difficult
          </Text>
        </Center>
      `,
      transformCode: (code) => {
        return transformedCode(code);
      },
      scope: {
        Wrapper,
        Divider,
        Text,
        Center,
      },
      argsType: {},
    }}
  />
</AppProvider>

<br />

## API Reference

### Import

To use this component in your project, include the following import statement in your file.

```jsx
import { Divider } from '@gluestack-ui/themed';
```

### Anatomy

The structure provided below can help you identify and understand a divider component's various parts.

```jsx
export default () => <Divider />;
```

### Component Props

This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.

#### Divider

It inherits all the properties of React Native's [View](https://reactnative.dev/docs/view) component.

## Themed

The themed version of the component is a pre-styled version of the component, which allows you to quickly integrate the component into your project. The component's design and functionality are fully defined, allowing you to focus on the more important aspects of your project. To know more about Themed Library please visit this [link](https://gluestack.io/ui/docs/core-concepts/themed-library).

### Props

Divider component is created using View component from react-native. It extends all the props supported by [React Native View](https://reactnative.dev/docs/view#props), [utility props](/ui/docs/styling/utility-and-sx-props) and the props mentioned below.

#### Divider

<AppProvider>
  <TableContainer>
    <Table>
      <Table.THead>
        <Table.TR>
          <Table.TH>
            <Table.TText>Name</Table.TText>
          </Table.TH>
          <Table.TH>
            <Table.TText>Value</Table.TText>
          </Table.TH>
          <Table.TH>
            <Table.TText>Default</Table.TText>
          </Table.TH>
        </Table.TR>
      </Table.THead>
      <Table.TBody>
        <Table.TR>
          <Table.TD>
            <Table.TText>
              <InlineCode>orientation</InlineCode>
            </Table.TText>
          </Table.TD>
          <Table.TD>
            <Table.TText>vertical | horizontal</Table.TText>
          </Table.TD>
          <Table.TD>
            <Table.TText>horizontal</Table.TText>
          </Table.TD>
        </Table.TR>
      </Table.TBody>
    </Table>
  </TableContainer>
</AppProvider>

> Note: These props are exclusively applicable when utilizing the default configuration of gluestack-ui/config. If you are using a custom theme, these props may not be available.

### Examples

The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.

#### Variants

A Divider component with different layouts offers versatile options for visually dividing content in various arrangements, such as horizontal or vertical orientations, enabling flexible and visually appealing designs for organizing and structuring elements within a user interface.

<AppProvider>
  <CodePreview
    showComponentRenderer={true}
    showArgsController={false}
    metaData={{
      code: `
        <VStack
          space="md"
          justifyContent='center'
          alignItems='center'
        >
          <HStack
            h='$10'
            justifyContent='center'
            alignItems='center'
          >
            <Text>Simple</Text>
            <Divider
              orientation="vertical"
              mx='$2.5'
              bg='$emerald500'
              h={15}
              $dark-bg="$emerald400"
            />
            <Text>Easy</Text>
            <Divider
              orientation="vertical"
              mx='$2.5'
              bg='$indigo500'
              h={15}
              $dark-bg="$indigo400"
            />
            <Text>Beautiful</Text>
          </HStack>
          <VStack
            w={100}
            justifyContent='center'
            alignItems='center'
          >
            <Text>Firefox</Text>
            <Divider
              w={55}
              variant="horizontal"
              bg="$red500"
              $dark-bg="$red400"
            />
            <Text>Chrome</Text>
          </VStack>
        </VStack>
      `,
      transformCode: (code) => {
        return transformedCode(code);
      },
      scope: {
        Wrapper,
        Divider,
        VStack,
        HStack,
        Text,
      },
      argsType: {},
    }}
  />
</AppProvider>

#### Orientation

A Divider component with a specified divider orientation allows for clear visual separation of content, either horizontally or vertically, providing a structured and organized layout within a user interface.

<AppProvider>
  <CodePreview
    _rendererWrapper={{ py: '$8' }}
    showComponentRenderer={true}
    showArgsController={false}
    metaData={{
      code: `
        <VStack
          space='lg'
          p='$12'
          borderColor='$backgroundLight300'
          borderWidth='$1'
          rounded='$lg'
          mx='$5'
          $dark-borderColor="$backgroundDark700"
          >
          <Box>
            <Text size='xs' color='$darkBlue600' fontWeight='$bold'>
              HEALTH
            </Text>
            <Heading>
              Benefits of Oranges
            </Heading>
            <Text size='sm' mt='$1.5'>
              Oranges are a great source of vitamin C, which is essential for a healthy immune system.
            </Text>
            <HStack space='sm' mt='$3' h='$5'>
              <Text size='xs'>
                Wade Warrem
              </Text>
              <Divider orientation='vertical' bg='$trueGray300' />
              <Text size='xs'>
                6th Oct, 2019
              </Text>
              <Divider orientation='vertical' bg='$trueGray300'/>
              <Text size='xs'>
                5 mins read
              </Text>
            </HStack>
          </Box>
          <Divider
            bg="$trueGray300"
            $dark-bg="$backgroundDark700"
            />
          <Box>
            <Text size='xs' color='$darkBlue600' fontWeight='$bold'>
              TECHNOLOGY
            </Text>
            <Heading>
              How AI can benefit your business
            </Heading>
            <Text size='sm' mt='$1.5'>
              AI can automate tasks and processes, allowing for increasing efficiency and productivity.
            </Text>
            <HStack space='sm' mt='$3' h='$5'>
              <Text size='xs'>
                Wade Warrem
              </Text>
              <Divider orientation='vertical' bg='$trueGray300'/>
              <Text size='xs'>
                6th Oct, 2019
              </Text>
              <Divider orientation='vertical' bg='$trueGray300'/>
              <Text size='xs'>
                5 mins read
              </Text>
            </HStack>
          </Box>
        </VStack>
      `,
      transformCode: (code) => {
        return transformedCode(code);
      },
      scope: {
        Wrapper,
        Divider,
        Box,
        Text,
        VStack,
        Heading,
        HStack,
      },
      argsType: {},
    }}
  />
</AppProvider>

#### With & Without Inset

A Divider component used with or without inset adds visual hierarchy and distinction by creating a dividing line either with or without indentation, providing options for organizing and structuring content within a user interface.

<AppProvider>
  <CodePreview
    _rendererWrapper={{ py: '$8' }}
    showComponentRenderer={true}
    showArgsController={false}
    metaData={{
      code: `
        <VStack space='2xl'>
          <HStack px='$3' h='$8' rounded='$sm' borderWidth='$1' borderColor='$backgroundLight300' $dark-borderColor="$backgroundDark700"
          >
            <Button variant='link' size='xs'>
              <ButtonText >
                Github
              </ButtonText>
            </Button>
            <Divider orientation='vertical' mx='$2.5'/>
            <Button variant='link' size='xs'>
              <ButtonText >
                Twitter
              </ButtonText>
            </Button>
            <Divider orientation='vertical' mx='$2.5'/>
            <Button variant='link' size='xs'>
              <ButtonText >
                Discord
              </ButtonText>
            </Button>
          </HStack>
          <HStack px='$3' h='$8' rounded='$sm' borderWidth='$1' borderColor='$backgroundLight300' alignItems='center' $dark-borderColor="$backgroundDark700"
          >
            <Button variant='link' size='xs'>
              <ButtonText >
                Github
              </ButtonText>
            </Button>
            <Divider orientation='vertical' h='50%' mx='$2.5'/>
            <Button variant='link' size='xs'>
              <ButtonText >
                Twitter
              </ButtonText>
            </Button>
            <Divider orientation='vertical' h='50%' mx='$2.5'/>
            <Button variant='link' size='xs'>
              <ButtonText >
                Discord
              </ButtonText>
            </Button>
          </HStack>
        </VStack>
      `,
      transformCode: (code) => {
        return transformedCode(code);
      },
      scope: {
        Wrapper,
        HStack,
        Divider,
        Button,
        ButtonText,
        VStack,
      },
      argsType: {},
    }}
  />
</AppProvider>

#### Adding content within a Divider

A Divider component with added content allows for the inclusion of additional text or elements alongside the dividing line, enhancing the visual and informational aspects of the divider while providing a seamless integration of content within a user interface.

<AppProvider>
  <CodePreview
    _rendererWrapper={{ py: '$8' }}
    showComponentRenderer={true}
    showArgsController={false}
    metaData={{
      code: `
        <Box py='$9' px='$20' m='$5' rounded='$lg' borderColor='$backgroundLight300' borderWidth='$1' $dark-borderColor="$backgroundDark700">
          <Heading size='3xl' >
            Search Results
          </Heading>
          <Divider mt='$4' mb='$6'/>
          <Box>
            <Text size='xs' color='$amber700' fontWeight='$bold'>
              TECHNOLOGY
            </Text>
            <Heading>
              How AI can benefit your business
            </Heading>
            <Text size='sm' mt='$1.5' >
              AI can automate tasks and processes, allowing for increasing efficiency and productivity.
            </Text>
            <HStack space='sm' mt='$3' alignItems='center'>
              <Divider bg='$amber700' w={18}/>
              <Text size='xs'  color='$amber700'>
                5 mins read
              </Text>
            </HStack>
          </Box>
        </Box>
      `,
      transformCode: (code) => {
        return transformedCode(code);
      },
      scope: {
        Wrapper,
        HStack,
        Divider,
        Box,
        Heading,
        Text,
      },
      argsType: {},
    }}
  />
</AppProvider>

## Unstyled

All the components in `gluestack-ui` are unstyled by default. To customize your UI using the extendedTheme, please refer to this [link](https://gluestack.io/ui/docs/theme-configuration/customizing-theme/eject-library). The import names of components serve as keys to customize each component.

## Spec Doc

Explore the comprehensive details of the Divider in this document, including its implementation details, checklist, and potential future additions. Dive into the thought process behind the component and gain insights into its development journey.

<iframe
  style={{
    borderRadius: '8px',
    border: ' 1px solid rgba(0, 0, 0, 0.1)',
    aspectRatio: 736 / 585,
  }}
  src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Fproto%2FNcXOxqKbdnGsLQNex3H76u%2F%25C2%25A0%25F0%259F%2593%259Agluestack-UI-handbook%3Fpage-id%3D6235%253A32067%26type%3Ddesign%26node-id%3D36691-1565%26viewport%3D920%252C274%252C0.04%26t%3DjMRBBCPwEPDbQwqL-1%26scaling%3Dscale-down%26starting-point-node-id%3D36691%253A1565%26mode%3Ddesign"
  allowFullScreen
/>

<!--

### Advanced

We provide in-depth information on how to customize and extend the component's functionality to meet your needs. Below, we describe how to modify the component to suit your requirements.

### Customizing the Divider

For customizing the Divider, you have to map styled view to Divider. You can refer [gluestack.io/style](/style/docs/getting-started/styled) on how to use styled components.

#### Usage

Default styling of the component can be found in the `components/divider` file. For reference, you can view the [source code](https://github.com/gluestack/gluestack-ui/blob/main/packages/themed/src/components/Divider) of the styled `Divider` component.

```jsx
// import the styles
import { Root } from '../components/core/divider/styled-components';

// import the createDivider function
import { createDivider } from '@gluestack-ui/divider';

// Understanding the API
const Divider = createDivider({
  Root,
});

// Using the Divider component
export default () => <Divider />;
```
-->
